package com.vegetable.modules.entity.inbound;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Map;

/**
 * <p>
 * 入库订单费用表
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="OrderCost对象", description="入库订单费用表")
public class OrderCost extends BaseEntity {

    @ApiModelProperty(value = "商品/d订单id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long mainId;

    @ApiModelProperty(value = "费用id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long costClauseId;

    @ApiModelProperty(value = "费用名称")
    private String costClauseName;

    @ApiModelProperty(value = "价格")
    private BigDecimal money;

    /**
     * 不能存明细id，因为新增的时候没有id，此时获取不到，只能前端传自己组的行号
     */
    @ApiModelProperty(value = "费用分摊的商品行Map<序号,重量>")
    @TableField(exist = false)
    private Map<Long, BigDecimal> serialNumberList;

}
